@extends('layouts.app')
@section('content')
    <div class="page-content">
        <div class="content">d
            <!-- 右侧内容框架，更改从这里开始 -->
            <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span1">礼物列表</span>
            <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span2">礼物添加</span>

            <br><br>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit"  id="px">排序</button>
            <div id="d1">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>排序</th>
                        <th>ID</th>
                        <th>类型</th>
                        <th>标识</th>
                        <th>名称</th>
                        <th>所需点数</th>
                        <th>图片</th>
                        <th>动画类型</th>
                        <th>动画</th>
                        <th>动画时长</th>
                        <th>发布时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($info as $k=>$v)
                        <tr>
                            <td><input type="button" value="{{$v->id}}" style="color:black "></td>
                            <td>{{$v->id}}</td>
                            <td>{{$v->type}}</td>
                            <td>{{$v->bs}}</td>
                            <td>{{$v->name}}</td>
                            <td>{{$v->num}}</td>
                            <td><img src="{{url('admin')}}/images/a.jpg"></td>
                            <td>{{$v->face_type}}</td>
                            <td>{{$v->dh}}</td>
                            <td>{{$v->dh_time}}</td>
                            <td>{{$v->fb_time}}</td>
                            <td>
                                <a href="{{url('zbfl_edit')}}?id=<?php echo $v->id; ?>">编辑</a>|
                                <a href="{{url('zbfl_del')}}?id=<?php echo $v->id; ?>">删除</a>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>

            <div id="d2">
                <form class="layui-form"  action="{{url('zblw_addlist')}}" method="post" enctype="multipart/form-data">
                    {{csrf_field()}}

                    <label class="control-label">礼物类型</label>
                    <div class="controls">
                        <label class="radio inline" for="type_0"><input type="radio" name="bs" value="0" id="type_0" checked >普通礼物</label>
                        <label class="radio inline" for="type_1"><input type="radio" name="bs" value="1" id="type_1"  >豪华礼物</label> <span class="form-required">*</span>
                    </div>

                    <div class="control-group">
                        <label class="control-label">礼物标识</label> <div class="controls"  >
                            <label class="radio inline" for="mark_0"><input type="radio" name="name" value="0" id="mark_0" checked >普通</label>
                            <label class="radio inline" for="mark_1"><input type="radio" name="name" value="1" id="mark_1"  >热门</label>
                            <label class="radio inline" for="mark_2"><input type="radio" name="name" value="2" id="mark_2"  >守护</label> <span class="form-required">*</span>
                        </div> </div>


                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>序号
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="level-name" name="level-name" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>礼物名称
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="level-name" name="name" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>所需点数
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="level-name" name="num" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>图片
                        </label>
                        <div class="layui-input-inline">
                            <input type="file" name="face">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label for="level-kiss" class="layui-form-label">
                            <span class="x-red">*</span>动画类型
                        </label>
                        <div class="layui-input-inline">
                            <label class="radio inline" for="swftype_0">
                                <input type="radio" name="dh" value="0" id="swftype_0" checked >GIF</label>
                            <label class="radio inline" for="swftype_1">
                                <input type="radio" name="dh" value="1" id="swftype_1"  >SVGA</label> <span class="form-required">*</span> </div> </div>

                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>动画图片
                        </label>
                        <div class="layui-input-inline">
                            <input type="file" id="level-name" name="dh" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>



                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>动画时间
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="level-name" name="dh_time" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>



                    <span class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="save" lay-submit="">
                    列表
                </button>


                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="save" lay-submit="">
                    添加
                </button>
        </span>



                </form>
            </div>
            <!-- 右侧内容框架，更改从这里结束 -->
        </div>

    </div>
@endsection
<style>
    #d2{
        display: none;
    }
</style>
<script src="{{asset('js')}}/app.js"></script>
<script>
    $(document).on("click","#span2",function(){
        if($("#d2").css("display")=="none"){
            $("#d2").css("display","block");
            $("#d1").css("display","none");
        }else{
            $("#d2").css("display","none");
            $("#d1").css("display","block");
        }
    })
    $(document).on("click","#span1",function(){
        if($("#d1").css("display")=="none"){
            $("#d1").css("display","block");
            $("#d2").css("display","none");
        }else{
            $("#d1").css("display","none");
            $("#d2").css("display","block");
        }
    })
</script>